package demo2;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: mirac
 * Date: 2025-07-26
 * Time: 17:25
 */
class MyArrays <T>{
    public Object[] arrays = new Object[10];

    public void setArrays(int pop,T obj) {
        this.arrays[pop] = obj;
    }
    public T getArrays(int pop) {
        return (T)this.arrays[pop];
    }
}
public class Main {
    public static void main(String[] args) {
        MyArrays<String> arrays= new MyArrays<>();
        arrays.setArrays(0,"1");
        arrays.setArrays(1,"hello");

        String str = arrays.getArrays(1);
        System.out.println(str);
    }
}
